#include<iostream>
#include <unistd.h>

#include <SDL.h>



using namespace std;


int main(int argc,const char* argv[]) {
    SDL_Surface* winSurface = NULL;
    SDL_Window* window = NULL;

    if( SDL_Init( SDL_INIT_EVERYTHING ) < 0 ){
        cout << "Error initializing SDL: " << SDL_GetError() << endl;
        pause();
        return 1;
    }


    window = SDL_CreateWindow("Example", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 1280, 720, SDL_WINDOW_SHOWN );

    if ( !window ) {
        cout << "Error creating window: " << SDL_GetError() << endl;
        pause();
        return 1;
    }
    winSurface = SDL_GetWindowSurface( window );
    if ( ! winSurface ) {
        cout << "Error getting surface: " << SDL_GetError() << endl;
        system("pause");
        return 1;
    }


    SDL_FillRect( winSurface, NULL, SDL_MapRGB( winSurface->format, 255, 255, 255 ) );

    SDL_UpdateWindowSurface( window );

    pause();

    SDL_DestroyWindow( window );

    SDL_Quit();

    return 0;
}


